//index.js
import { bg } from '../../utils/canvas/index.js';
//import {Authorize,getCanvasPic} from '../../utils/utils.js';
//获取应用实例
//const app = getApp()

Page({

  data: {
    canvas_form: {},
  },
  //事件处理函数
  bindViewTap: function() {
    wx.navigateTo({
      url: '../logs/logs'
    })
  },
  onLoad: function () {
  
  },

  setCanvas :()=>{
    const canvas_  = wx.createCanvasContext("firstCanvas");
    console.log(canvas_);
    canvas_.save(); //初始化保存状态
    bg.paint(canvas_);
    console.log(bg.left);
    canvas_.draw(); //绘制
  },

   onShow:function(){
    const that =this;
    that.setCanvas();
   }
   
})
